#include <bits/stdc++.h>
using namespace std;
#define int long long
void solve()
{
    int n,q;
    cin>>n>>q;
    vector<int>v(n+1);
    set<int>s;
    unordered_map<int, int>m;
    int mx=0;
    int cnt1=0;
    for(int i=1;i<=n;i++)
    {
        cin>>v[i];
        if(v[i]==1)cnt1++;
        mx=max(mx,v[i]);
        s.insert(v[i]);
        m[v[i]]++;
    }
    int x;
    for(int i=1;i<=q;i++)
    {
        cin>>x;
        bool flag=0;
        if(x==1)
        {
            for(auto z:m)
            {
                if(z.second>=2)
                {
                    cout<<"YES"<<endl;
                    flag=1;
                    break;
                }
            }
        }
        else 
        {
            for(auto z:s)
            {
                if(m[x*z])
                {
                    cout<<"YES"<<endl;
                    flag=1;
                    break;
                }
                if(x*z>mx)break;
            }
        }
        if(!flag)cout<<"NO"<<endl;
    }
}
signed main()
{
    //ios::sync_with_stdio(false);
    //cin.tie(nullptr);
    int T=1;
    //cin>>T;
    while(T--)
    {
       solve();
    }
    return 0;
}